package com.cyt.work.site.model.po;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.cyt.base.util.BaseUtil;
import com.cyt.base.util.DictCode;
import com.cyt.sys.model.po.SysUser;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 微官网-新生报名实体类
 *
 * @author rong yuan
 * @date 2019-7-8 19:39:31
 */
@Data
@NoArgsConstructor
@Table(name = "cyt_site_student")
public class Student implements Serializable {

    /**
     * 主键ID
     */
    @Id
    private String id;

    /**
     * 应用ID
     */
    @Column(name = "apply_id")
    private String applyId;

    /**
     * 学段：1-初中一年级；2-高中一年级
     */
    @Excel(name = "学段", replace = {"初中一年级_1", "高中一年级_2"}, orderNum = "1")
    @Column(name = "period_type")
    private String periodType;

    /**
     * 帐号
     */
    @Excel(name = "帐号", orderNum = "2")
    @Column(name = "login_name")
    private String loginName;

    /**
     * 密码
     */
    @Column(name = "password")
    private String password;

    /**
     * 学籍号
     */
    @Excel(name = "学籍号", orderNum = "3")
    @Column(name = "student_code")
    private String studentCode;

    /**
     * 姓名
     */
    @Excel(name = "姓名", orderNum = "4")
    @Column(name = "student_name")
    private String studentName;

    /**
     * 身份证号
     */
    @Excel(name = "身份证号", orderNum = "5")
    @Column(name = "id_number")
    private String idNumber;

    /**
     * 监护人身份证号
     */
    @Excel(name = "监护人身份证号", orderNum = "6")
    @Column(name = "guardian_id_number")
    private String guardianIdNumber;

    /**
     * 是否删除：1-未删除；2-已删除
     */
    @Column(name = "remove_tag")
    private String removeTag;

    /**
     * 创建人
     */
    @Column(name = "create_user")
    private String createUser;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 更新人
     */
    @Column(name = "update_user")
    private String updateUser;

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 创建对象
     *
     * @param sysUser 当前用户信息
     * @author rong yuan
     * @date 2019-7-8 19:39:31
     */
    public Student(SysUser sysUser) {
        this.id = BaseUtil.uId();
        this.removeTag = DictCode.BASE_REMOVE_TAG_NORMAL;
        this.createTime = new Date();
        this.createUser = sysUser.getId();
        this.updateTime = new Date();
        this.updateUser = sysUser.getId();
    }
}